package com.ying.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ying.domain.UserOne;
import com.ying.mapper.UserOneMapper;
import com.ying.service.IUserOneService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author liujunjie
 * @Description description
 * @Date 2024-10-08 18:55
 **/
@Service
public class UserOneService extends ServiceImpl<UserOneMapper, UserOne> implements IUserOneService {
    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public void required(UserOne userOne) {
        baseMapper.insert(userOne);
    }

    @Override
    @Transactional(propagation = Propagation.REQUIRED)
    public void requiredException(UserOne userOne) {
        baseMapper.insert(userOne);
        throw new RuntimeException();
    }
}
